#region Using directives

using System;

using FighterChessEngine.Enum;
using FighterChessEngine.FC_Board;

#endregion

namespace FighterChessEngine.FC_Fighter.Fighters
{
    /// <summary>
    /// Summary description for King.
    /// </summary>
    public class King : Fighter
    {
        #region Atributes
        #endregion

        #region Properties
        #endregion

        #region Methods
        public King() : base()
        {
            Init();
            level = 10;
        }

        public King(Owner owner, Square pos) : base(owner, pos)
        {
            Init();
            level = 10;
        }

        public King(string strKing)
            : base(strKing)
        {
            Init();
        }

        private void Init()
        {
            name = "King";
            symbol = "KI";
            type = FighterType.King;
        }

        public override void UpdateNextPositions(Fighter[,] fighters)
        {
            base.UpdateNextPositions(fighters);

            for (int row = currentPos.Row - 1; row <= currentPos.Row + 1; row++)
                for (int col = currentPos.Col - 1; col <= currentPos.Col + 1; col++)
                {
                    // current pos
                    if (row == currentPos.Row && col == currentPos.Col)
                        continue;

                    int checkResult = CheckSquare(fighters, row, col);
                    if (checkResult == 0 || checkResult == 2)
                        arrNextPos.Add(new Square(row, col));
                }

        }
        #endregion
    }
}
